Grokking System Design Fundamentals
Rate this course
Ask Author
Contribute
Back to course home

62% completed

Vote For New Content
System Design Fundamentals
Introduction to System Design
Load Balancing
Introduction to Load Balancing
Load Balancing Algorithms
Uses of Load Balancing
Load Balancer Types
Stateless vs. Stateful Load Balancing
High Availability and Fault Tolerance
Scalability and Performance
Challenges of Load Balancers
API Gateway
Introduction to API Gateway
Usage of API gateway
Advantages and disadvantages of using API gateway
Key Characteristics of Distributed Systems
Scalability
Availability
Latency and Performance
Concurrency and Coordination
Monitoring and Observability
Resilience and Error Handling
Fault Tolerance vs. High Availability
Network Essentials
HTTP vs. HTTPS
TCP vs. UDP
HTTP: 1.0 vs. 1.1 vs 2.0 vs. 3.0
URL vs. URI vs. URN
Domain Name System (DNS)
Introduction to DNS
DNS Resolution Process
DNS Load Balancing and High Availability
Caching
Introduction to Caching
Why is Caching Important?
Types of Caching
Cache Replacement Policies
Cache Invalidation
Cache Read Strategies
Cache Coherence and Consistency Models
Caching Challenges
Cache Performance Metrics
CDN
What is CDN?
Origin Server vs. Edge Server
CDN Architecture
Push CDN vs. Pull CDN
Data Partitioning
Introduction to Data Partitioning
Partitioning Methods
Data Sharding Techniques
Benefits of Data Partitioning
Common Problems Associated with Data Partitioning
Proxies
What is a Proxy Server?
Uses of Proxies
VPN vs. Proxy Server
Redundancy and Replication
What is Redundancy?
What is Replication?
Replication Methods
Data Backup vs. Disaster Recovery
CAP & PACELC Theorems
Introduction to CAP Theorem
Components of CAP Theorem
Trade-offs in CAP Theorem
Examples of CAP Theorem in Practice
Beyond CAP Theorem
System Design Trade-offs in Interviews
Databases (SQL vs. NoSQL)
Introduction to Databases
SQL Databases
NoSQL Databases
SQL vs. NoSQL
ACID vs BASE Properties
Real-World Examples and Case Studies
SQL Normalization and Denormalization
In-Memory Database vs. On-Disk Database
Data Replication vs. Data Mirroring
Database Federation
What are Indexes?
Types of Indexes
Introduction to Bloom Filters
Benefits & Limitations of Bloom Filters
Variants and Extensions of Bloom Filters
Applications of Bloom Filters
Difference Between Long-Polling, WebSockets, and Server-Sent Events
What is Quorum?
What is Heartbeat?
What is Checksum?
Uses of Checksum
What is Leader and Follower Pattern?
What is Security and Privacy?
What is Authentication?
What is Authorization?
Authentication vs. Authorization
OAuth vs. JWT for Authentication
What is Encryption?
What are DDoS Attacks?
Introduction to Messaging System
Introduction to Kafka
Messaging patterns
Popular Messaging Queue Systems
RabbitMQ vs. Kafka vs. ActiveMQ
Scalability and Performance
What is a Distributed File System?
Architecture of a Distributed File System
Key Components of a DFS
Batch Processing vs. Stream Processing
XML vs. JSON
Synchronous vs. Asynchronous Communication
Push vs. Pull Notification Systems
Microservices vs. Serverless Architecture
Message Queues vs. Service Bus
Stateful vs. Stateless Architecture
Event-Driven vs. Polling Architecture
Quiz
In-Memory Database vs. On-Disk Database

In-memory databases and on-disk databases are two types of database systems designed for storing and managing data, but they fundamentally differ in how and where they store their data. Understanding these differences is key to choosing the right type of database for a specific application or workload.

In-Memory Database (IMDB)

Storage Mechanism:

  • Data Storage: Primarily stores data in the main memory (RAM) of the server.
  • Persistence: Some in-memory databases can persist data on disk, but the primary data access and manipulation happen in memory.

Performance:

  • Speed: Offers high performance and low latency, as accessing data in RAM is significantly faster than disk access.
  • Efficiency: Especially efficient for read-heavy operations and complex, real-time computations.

Use Cases:

  • Real-Time Analytics: Ideal for applications that require real-time analysis and reporting.
  • Caching: Commonly used for caching where quick data retrieval is crucial.
  • Session Storage: Used in web applications for session management.

Limitations:

  • Cost: Generally more expensive due to the high cost of RAM.
  • Scalability: Scaling large volumes of data can be challenging and costly.
  • Data Volatility: In the event of power loss or system crash, data stored only in memory can be lost unless the database is designed with persistence mechanisms.

Examples of In-Memory Databases

  1. Redis:

    • A widely used in-memory data store, often employed as a distributed cache, message broker, and for quick read/write operations. Redis supports various data structures such as strings, hashes, lists, sets, and sorted sets.
  2. Memcached:

    • A high-performance, distributed memory caching system, originally intended for speeding up dynamic web applications by alleviating database load.
  3. SAP HANA:

    • An in-memory, column-oriented, relational database management system. HANA is known for advanced analytics processing, such as OLAP and OLTP processing on the same platform.
  4. Apache Ignite:

    • A memory-centric distributed database, caching, and processing platform for transactional, analytical, and streaming workloads.
  5. Hazelcast IMDG:

    • An in-memory data grid that offers distributed data structures and computing utilities. It's often used for scalable caching and in-memory data storage.

On-Disk Database

Storage Mechanism:

  • Data Storage: Stores data on persistent disk storage (HDD or SSD).
  • Persistence: Data is inherently persistent and does not require additional mechanisms to survive system restarts.

Performance:

  • Speed: Generally slower compared to in-memory databases due to the time required for disk I/O operations.
  • Suitability: More suited for applications where the speed of data access is less critical.

Use Cases:

  • Transactional Systems: Widely used in transactional applications (OLTP systems), where data persistence is key.
  • Large Data Sets: Ideal for applications with large data sets that cannot be cost-effectively stored in memory.
  • General-Purpose Databases: Most traditional databases (like MySQL, PostgreSQL) are on-disk and cater to a wide range of applications.

Limitations:

  • Speed: The speed can be a limiting factor, especially for applications requiring real-time response.
  • I/O Bottlenecks: Performance can be bottlenecked by disk I/O, particularly in high-throughput scenarios.

Examples of On-Disk Databases

  1. MySQL:

    • One of the most popular open-source relational database management systems. MySQL is widely used for web applications and supports a broad array of features.
  2. PostgreSQL:

    • An advanced open-source relational database. PostgreSQL is known for its robustness, scalability, and support for advanced data types and features.
  3. MongoDB:

    • A leading NoSQL database that stores data in JSON-like documents. It is designed for ease of development and scaling.
  4. Oracle Database:

    • A multi-model database management system known for its feature-rich, enterprise-grade capabilities, widely used in large organizations.
  5. Microsoft SQL Server:

    • A relational database management system developed by Microsoft, offering a wide range of data analytics, business intelligence, and transaction processing capabilities.
  6. SQLite:

    • A C-language library that implements a small, fast, self-contained, high-reliability SQL database engine. It's widely used in applications where an embedded, lightweight database is needed.

Key Differences

  1. Data Storage Location:

    • IMDB: Main memory (RAM).
    • On-Disk Database: Persistent disk storage.
  2. Performance:

    • IMDB: Faster read/write operations.
    • On-Disk Database: Slower, depending on disk I/O.
  3. Cost and Scalability:

    • IMDB: Higher cost, scaling large data sets is more challenging.
    • On-Disk Database: More cost-effective for large data volumes.
  4. Data Persistence:

    • IMDB: Requires mechanisms for data durability.
    • On-Disk Database: Inherently persistent.
  5. Use Cases:

    • IMDB: Real-time processing, caching, session storage.
    • On-Disk Database: Transactional systems, large data storage, general-purpose usage.

Each type of database serves different needs: in-memory databases are optimal for scenarios requiring rapid data access and processing, while on-disk databases are better suited for applications needing reliable data persistence and management of large data volumes. The choice depends on specific application requirements, including performance needs, data size, and persistence considerations.

SQL Normalization and Denormalization
Data Replication vs. Data Mirroring
Mark as Completed

On this page

In-Memory Database (IMDB)

Storage Mechanism:

Performance:

Use Cases:

Limitations:

Examples of In-Memory Databases

On-Disk Database

Storage Mechanism:

Performance:

Use Cases:

Limitations:

Examples of On-Disk Databases

Key Differences